<?php
$this->load->view('header');
?>

<script type="text/javascript">
$(document).ready(function() {
        <?=$pquery->observe_field('#linkclick',array('event'=>'click','function'=>'alert(\'Someone Clicked me\')'));?> 
        <?=$pquery->observe_field('#inputchange',array('event'=>'change','function'=>'alert(\'Ive got Changed\')'));?> 
});
</script>

<p><strong>observe_field</strong> - simple observe field.</p>
<a id="linkclick" href="#">Im being observed for clicks<a><br /><br />
<input type="text" name="name" id="inputchange" value=""/>


<hr />
<p><strong>observe_field</strong> - Ajax validation.</p>
<script type="text/javascript">
$(document).ready(function() {
        <?=$pquery->observe_field('#inputemail',array('event'=>'keyup','function'=>$pquery->remote_function(array('url'=>CONTURL.'validate/','update'=>'#ajaxvalidate','with'=>'email="+$("#inputemail").val()+"','type'=>'POST'))));?>
});
</script>

Email : <input type="text" name="name" id="inputemail" value=""/> (<b><span id='ajaxvalidate'>enter</b>)


<script type="text/javascript">
 $(document).ready(function() {
 	 <?=$pquery->periodically_call_remote(array('url'=>CONTURL.'ajaxtime/"+new Date().getTime()+"','update'=>'#idtime','frequency'=>1));?> 	
  });
</script>

<p><div id="idtime">Ajax Time</div></p>
<hr />
<lable>Postcode: </lable>
<?php

echo form_input(array(
        'name'        => 'Postcode',
        'id'          => 'Postcode',
        'value'       => '',
        'size'        => '10',
        'onFocus'     => 'clearValue(this)'
        )
    ).'<span id="postresult"></span>';
?>




<?php
$this->load->view('footer');
?>
